package _interview75;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 1431. 拥有最多糖果的孩子
 */
public class No1431 {
    public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
        int max = Arrays.stream(candies).max().orElseThrow();
        List<Boolean> answer = new ArrayList<>();
        for (int candy : candies) {
            answer.add(candy + extraCandies >= max);
        }
        return answer;
    }
}
